#include <angelscript.h>
#include <assert.h>
#include <IProcessor.h>
#include <Kernel.h>

using namespace std;

 void processortest()
{
	cout << "sampler processor plugin : SamplerView ..." << endl; 
}

class SamplerProcessor : public IProcessor
{
public:
    __declspec(dllexport) virtual ~SamplerProcessor() {}

    __declspec(dllexport)  SamplerProcessor()
	{
		;
	}

	__declspec(dllexport) virtual void config(asIScriptEngine *engine)
	{
		int r;
		r = engine->RegisterGlobalFunction("void processortest()",asFUNCTION(processortest),asCALL_CDECL); assert(r >= 0);
	}
    /// Get name of the graphics driver
    __declspec(dllexport) virtual const std::string &getName() const {
      static string sName("Sampler Processor Plugin");
      return sName;

    }
};

/// Retrieve the engine version we're going to expect
extern "C" __declspec(dllexport) int getVersion() {
  return 1;
}

/// Tells us to register our functionality to an engine kernel
extern "C" __declspec(dllexport) void registerPlugin(Kernel &K) {
  K.getProcessorManager().addProcessor(
    auto_ptr<IProcessor>(new SamplerProcessor())
  );
}